package sin.dao.impl;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Component;

import sin.dao.TeacherDao;
import sin.entity.Teacher;

@Component("studentDao")
public class TeacherDaoImpl extends HibernateDaoSupport implements TeacherDao {

	@Override
	public Teacher getById(String id) {
		return (Teacher) this.getSession().get(Teacher.class, id);
	}

	@Override
	public void saveTeacher(Teacher teacher) {
		this.getSession().save(teacher);
	}

	@Override
	public void deleteById(String id) {
		Object stu = this.getSession().get(Teacher.class, id);
		this.getSession().delete(stu);
	}

}
